<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('group[]', $groupdata, $groupids, ['class'=>'form-control selectpicker group', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="form-group">
        <label for="username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="username" name="row[username]" value="{$row.username|htmlentities}" data-rule="required;username" />
        </div>
    </div>
    <div class="form-group">
        <label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="email" class="form-control" id="email" name="row[email]" value="{$row.email|htmlentities}" data-rule="required;email" />
        </div>
    </div>
    <div class="form-group shop_id">
        <label class="control-label col-xs-12 col-sm-2">商户:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-shop_id" data-rule="required" data-source="store_shop/index" data-params='{"custom[status]":"1"}' class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id}">
        </div>
    </div>


    <div class="form-group agent_city" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('代理区域')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class='control-relative'><input id="c-agent_city" class="form-control" data-toggle="city-picker" name="row[agent_city]" type="text" value="{$row.agent_city}"></div>
        </div>
    </div>



    <div class="form-group agent_power" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('代理权限')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[agent_power]', [1=>__('可开代理与商户'), 0=>__('仅开商户')], $row['agent_power'])}
        </div>
    </div>




    <div class="form-group agent_level" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('代理等级')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control col-sm-8" name="row[agent_level]" >
                <option value =1 {if($row.agent_level==1)} checked {/if} >等级一</option>
                <option value =2 {if($row.agent_level==2)} checked {/if} >等级二</option>
                <option value =3 {if($row.agent_level==3)} checked  {/if}>等级三</option>
            </select>
        </div>
    </div>

    {include file="auth/admin/agent_domain" /}

    <div class="form-group config_id " >
        <label class="control-label col-xs-12 col-sm-2">{:__('账号套餐')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-seller_config" data-rule="required" data-source="seller_config/index"  class="form-control selectpage" name="row[config_id]" type="text" value="{$row.config_id}">
        </div>
    </div>


    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="{$row.nickname|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="password" class="form-control" id="password" name="row[password]" autocomplete="new-password" value="" data-rule="password" />
        </div>
    </div>
    <div class="form-group">
        <label for="loginfailure" class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="loginfailure" name="row[loginfailure]" value="{$row.loginfailure}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>
    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>